<script th:fragment="pagination(pageNumber,pageSize,totalPages)">
    //当前页数
    let pageNumber = [[${pageNumber}]];
    //每一页的条数
    let pageSize = [[${pageSize}]];
    //总的页数
    const totalPages = [[${localVar.totalPages}]];
    function prev() {
        if (pageNumber > 1) {
            pageNumber--;
        }
        window.location.href = `?pageNumber=${pageNumber}&pageSize=${pageSize}`;
    }

    function next() {
        if (pageNumber < totalPages) {
            pageNumber++;
        }
        window.location.href = `?pageNumber=${pageNumber}&pageSize=${pageSize}`;
    }
</script>
